package com.ctshk.sapp.ship.controller;


import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.model.TokenUser;
import com.ctshk.rpc.ship.dto.MainDataShipCompanyListDTO;
import com.ctshk.rpc.ship.dto.ShipProductDetailDTO;
import com.ctshk.rpc.ship.req.ShipProductReq;
import com.ctshk.rpc.ship.service.IMainDataShipCompanyService;
import com.ctshk.rpc.ship.service.IShipProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import com.ctshk.common.web.support.BaseController;

import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 船票公司主数据 前端控制器
 * </p>
 *
 * @author 刘蕾
 * @since 2021-04-13
 */
@Api(value = "船票公司主数据",tags = "船票公司主数据")
@RestController
@RequestMapping("/main-data-ship-company")
public class MainDataShipCompanyController extends BaseController {

    @DubboReference
    private IMainDataShipCompanyService iMainDataShipCompanyService;

    @ApiOperation(value = "查询船票公司主数据", notes = "查询船票公司主数据")
    @OperationLogAnnotation(operModul = OperationLogModel.TICKET, operType = OperationLogType.QUERY, operTitle = "查询船票公司主数据", operDesc = "查询船票公司主数据")
    @GetMapping(value = "/queryMainDataList")
    public Result<List<MainDataShipCompanyListDTO>> queryMainDataList() {
        return Result.success(iMainDataShipCompanyService.queryMainDataList());
    }

    @ApiOperation(value = "查询船票公司主数据-提供给推广码，需要POST提交方式", notes = "查询船票公司主数据-提供给推广码，需要POST提交方式")
    @OperationLogAnnotation(operModul = OperationLogModel.TICKET, operType = OperationLogType.QUERY, operTitle = "查询船票公司主数据", operDesc = "查询船票公司主数据-提供给推广码，需要POST提交方式")
    @PostMapping(value = "/postQueryMainDataList")
    public Result<List<MainDataShipCompanyListDTO>> PostQueryMainDataList(@RequestParam("name")String name) {
        return Result.success(iMainDataShipCompanyService.queryMainData(name));
    }
}
